package com.cw2.creatation.prototype;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
public class User implements Cloneable{

    public User(){
        System.out.println("User 对象被创建");
    }

    private String name;
    private Integer age;

    @Override
    protected Object clone() {
        User user = new User();
        user.setName(this.name);
        user.setAge(this.age);
        return user;
    }
}
